<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%
    String manager = (String) session.getAttribute("loggedUser");
    if( manager != null ) {
%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Student Management</title>
        <link rel="stylesheet" href="Assets/css/bootstrap.min.css" />
        <link rel="stylesheet" href="Assets/css/font-awesome.min.css" />
        <link rel="stylesheet" href="Assets/css/jquery.contextMenu.css" />
        <link rel="stylesheet" href="Assets/css/style.css" />
        <link rel="stylesheet" href="Assets/css/dashboard.css" />
        <script src="Assets/js/jquery-2.1.1.min.js"></script>        
        <script src="Assets/js/bootstrap.min.js"></script>
        <script src="Assets/js/jquery.contextMenu.js"></script>
        <script src="Assets/js/myscript.js"></script>
    </head>
    <body>
        <% String action = request.getParameter("action"); %>
        <div class="container">
            <div class="row">
                
            <%
                if(action == null) {//access directly
                %>
                    <%@ include file="includes/listStudent.jsp" %>
                <%
                }else {
                    if(action.equalsIgnoreCase("add")) {
                %>
                    <%@ include file="includes/addStudent.jsp" %>
                <%
                    } else if(action.equalsIgnoreCase("edit")) {
                %>
                    <%@ include file="includes/updateStudent.jsp" %>
                <%                        
                    } else if(action.equalsIgnoreCase("delete")) {
                %>
                    <%@ include file="includes/deleteStudent.jsp" %>
                <%                        
                    }
                }
            %>
            </div>
        </div>
            <div class="footercp">
                <a href="Index.jsp">Homepage</a> |
                <a href="Dashboard.jsp">CMS Dashboard</a> | 
                <a href="Student.jsp">Students Management</a> |
                <a href="Dashboard.jsp?view=logout">Logout</a>
            </div>
    </body>
</html>
<% } else {
        response.sendRedirect("Login.jsp");
    }
%>